package com.example.jdcompetition.Controller;

import com.example.jdcompetition.Entity.CallResultMsg;
import com.example.jdcompetition.Service.MemoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author henrydai
 * @date 2021/6/16 13:31
 */
@RestController
@Slf4j
public class MemoryController {
    @Autowired
    private UniformReponseHandler<String> uniformReponseHandler;
    @Autowired
    private MemoryService memoryService;

    @GetMapping(value = "/memory",produces = "application/json")
    public CallResultMsg getMemory()
    {
        log.info("接收一条查询内存请求");
        return uniformReponseHandler.sendSuccessResponse(memoryService.getMemory());
    }
}
